# !ResEd common Makefile

# ****** EDIT MAKEPROTO, NOT MAKEFILE ******
# Then construct Makefile using "amu -f MakeProto depend"

CPFLAGS = A~C~DF~L~N~P~Q~R~S~T~V

# Can set:
#  CFLAGS     -  additional cc options
#  INCLUDES   -  locations to search for "included" files
#  AFLAGS     -  additional objasm options

INCLUDES =

OFILES = dbmalloc.o dbox.o debug.o dragdrop.o error.o interactor.o menu.o message.o registry.o saveas.o wimp.o toolbox.o focus.o swicall.o

CFILES = dbmalloc.c dbox.c debug.c dragdrop.c error.c interactor.c menu.c message.c registry.c saveas.c wimp.c toolbox.c focus.c

all: commonlib.o
        @echo *** Commonlib build complete

commonlib.o: $(OFILES)
        libfile -c -o commonlib.o $(OFILES)

.c.o:
        cc -c $(CFLAGS) $(INCLUDES) -o $@ $<

.s.o:
        objasm -quit -CloseExec $(AFLAGS) -from $< -to $@

depend:
        copy MakeProto Makefile1 $(CPFLAGS)
        cc -c -M $(INCLUDES) $(CFILES) >> Makefile1
        remove Makefile0
        -rename Makefile Makefile0
        rename Makefile1 Makefile
        @echo *** Commonlib dependencies established

clean:
       create o.foo
       wipe o.* ~CRF~V
       @echo *** Common cleaned

# Dependencies following this line provided by make depend

